home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _0C0ACE0E74C04C6C8EF972B12F90FF66 < prev    next >
Encoding:
Text File  |  2004-01-06  |  5.9 KB  |  224 lines

  1. -- [Michael G.] load a different texture for low and medium spec
  2. function GetScopeTex()
  3.     local sysspec = getglobal( "sys_spec" );
  4.     if (sysspec~=nil and tonumber(sysspec) < 1) then
  5.         return System:LoadImage("Textures/Hud/crosshair/OICW_Scope_low.dds");
  6.     else
  7.         return System:LoadImage("Textures/Hud/crosshair/OICW_Scope.dds");
  8.     end
  9. end
  10.  
  11.  
  12. OICW = {
  13.     name            = "OICW",
  14.     object        = "Objects/Weapons/oicw/oicw_bind.cgf",
  15.     character    = "Objects/Weapons/oicw/oicw.cgf",
  16.     
  17.     -- if the weapon supports zooming then add this...
  18.     ZoomActive = 0,                                                -- initially always 0
  19.     MaxZoomSteps = 1,
  20.     ZoomSteps = { 3 },
  21.     ---------------------------------------------------
  22.     PlayerSlowDown = 0.8,                                    -- factor to slow down the player when he holds that weapon
  23.     ---------------------------------------------------
  24.     ActivateSound = Sound:LoadSound("Sounds/Weapons/oicw/oicwact.wav",0,155),    -- sound to play when this weapon is selected
  25.     ZoomNoSway=1,
  26.     ---------------------------------------------------
  27.     DrawFlare=1,
  28.     ---------------------------------------------------    
  29.     FireParams ={                                                    -- describes all supported firemodes
  30.     {
  31.         FModeActivationTime=1,
  32.         HasCrosshair=1,
  33.         AmmoType="Assault",
  34.         ammo=120,
  35.         reload_time=2.02, -- default 2.55
  36.         fire_rate=0.05,
  37.         distance=1600,
  38.         damage=15, -- Default = 9
  39.         damage_drop_per_meter=.007,
  40.         bullet_per_shot=1,
  41.         bullets_per_clip=40,
  42.         iImpactForceMul = 20,
  43.         iImpactForceMulFinal = 100,
  44.         fire_activation=bor(FireActivation_OnPress,FireActivation_OnHold),
  45.         
  46.         -- recoil values
  47.         min_recoil=0,
  48.         max_recoil=0.8,    -- its only a small recoil as more people seem to like it that way
  49.         
  50.         BulletRejectType=BULLET_REJECT_TYPE_RAPID,
  51.         
  52.         -- make sure that the last parameter in each sound (max-distance) is equal to "whizz_sound_radius"
  53.         whizz_sound_radius=6,
  54.         whizz_probability=250,    -- 0-1000
  55.         whizz_sound={
  56.             Sound:Load3DSound("Sounds/weapons/bullets/whiz1.wav",SOUND_UNSCALABLE,100,1,6),
  57.             Sound:Load3DSound("Sounds/weapons/bullets/whiz2.wav",SOUND_UNSCALABLE,100,1,6),
  58.             Sound:Load3DSound("Sounds/weapons/bullets/whiz3.wav",SOUND_UNSCALABLE,100,1,6),
  59.             Sound:Load3DSound("Sounds/weapons/bullets/whiz4.wav",SOUND_UNSCALABLE,100,1,6),
  60.         },
  61.         
  62.         FireLoop="Sounds/Weapons/oicw/FINAL_OICW_MONO_LOOP.wav",
  63.         FireLoopStereo="Sounds/Weapons/oicw/FINAL_OICW_STEREO_LOOP.wav",
  64.         TrailOff="Sounds/Weapons/oicw/FINAL_OICW_MONO_TAIL.wav",
  65.         TrailOffStereo="Sounds/Weapons/oicw/FINAL_OICW_STEREO_TAIL.wav",
  66.         DrySound = "Sounds/Weapons/oicw/DryFire.wav",
  67.                             
  68.         ScopeTexId = GetScopeTex(),
  69.         
  70.         -- No light means faster frame rate
  71.         --LightFlash = {
  72.         --    fRadius = 5.0,
  73.         --    vDiffRGBA = { r = 1.0, g = 1.0, b = 0.0, a = 1.0, },
  74.         --    vSpecRGBA = { r = 0.3, g = 0.3, b = 0.3, a = 1.0, },
  75.         --    fLifeTime = 0.75,
  76.         --},
  77.  
  78.         ShellCases = {
  79.             geometry=System:LoadObject("Objects/Weapons/shells/rifleshell.cgf"),
  80.             focus = 1.5,
  81.             color = { 1, 1, 1},
  82.             speed = 0.1,
  83.             count = 1,
  84.             size = 3.0, 
  85.             size_speed = 0.0,
  86.             gravity = { x = 0.0, y = 0.0, z = -9.81 },
  87.             lifetime = 5.0,
  88.             frames = 0,
  89.             color_based_blending = 0,
  90.             particle_type = 0,
  91.         },
  92.  
  93.         -- remove this if not nedded for current weapon
  94.         MuzzleFlash = {
  95.             geometry_name = "Objects/Weapons/Muzzle_flash/mf_OICW_fpv.cgf",
  96.             bone_name = "spitfire",
  97.             lifetime = 0.125,
  98.         },
  99.         MuzzleFlashTPV = {
  100.             geometry_name = "Objects/Weapons/Muzzle_flash/mf_OICW_tpv.cgf",
  101.             bone_name = "weapon_bone",
  102.             lifetime = 0.05,
  103.         },
  104.         
  105.         -- trace "moving bullet"    
  106.         -- remove this if not nedded for current weapon
  107.         Trace = {
  108.             geometry=System:LoadObject("Objects/Weapons/trail.cgf"),
  109.             focus = 5000,
  110.             color = { 1, 1, 1},
  111.             speed = 120.0,
  112.             count = 1,
  113.             size = 1.0, 
  114.             size_speed = 0.0,
  115.             gravity = { x = 0.0, y = 0.0, z = 0.0 },
  116.             lifetime = 0.04,
  117.             frames = 0,
  118.             color_based_blending = 3,
  119.             particle_type = 0,
  120.         },
  121.  
  122.         SoundMinMaxVol = { 255, 5, 500 },
  123.     },
  124.     {
  125.         no_zoom = 1,
  126.         FModeActivationTime=1,
  127.         HasCrosshair=1,
  128.         AmmoType="OICWGrenade",
  129.         projectile_class="OICWGrenade",
  130.         ammo=500,
  131.         reload_time=2.5,
  132.         fire_rate=1.0,
  133.         fire_activation=FireActivation_OnPress,
  134.         bullet_per_shot=1,
  135.         bullets_per_clip=5,
  136.         
  137.         FireSounds = {
  138.             "Sounds/Weapons/OICW/FINAL_OICW_MONO_GRENADE.wav",
  139.             "Sounds/Weapons/OICW/FINAL_OICW_MONO_GRENADE.wav",
  140.             "Sounds/Weapons/OICW/FINAL_OICW_MONO_GRENADE.wav",
  141.         },
  142.         FireSoundsStereo = {
  143.             "Sounds/Weapons/OICW/FINAL_OICW_STEREO_GRENADE.wav",
  144.             "Sounds/Weapons/OICW/FINAL_OICW_STEREO_GRENADE.wav",
  145.             "Sounds/Weapons/OICW/FINAL_OICW_STEREO_GRENADE.wav",
  146.         },
  147.         DrySound = "Sounds/Weapons/AG36/DryFire.wav",
  148.         
  149.         -- No light means more frames
  150.         --LightFlash = {
  151.         --    fRadius = 5.0,
  152.         --    vDiffRGBA = { r = 1.0, g = 1.0, b = 0.0, a = 1.0, },
  153.         --    vSpecRGBA = { r = 0.3, g = 0.3, b = 0.3, a = 1.0, },
  154.         --    fLifeTime = 0.75,
  155.         --},
  156.  
  157.         SoundMinMaxVol = { 255, 5, 500 },
  158.     }
  159.  
  160.     },
  161.  
  162.         SoundEvents={
  163.         --    animname,    frame,    soundfile                                                ---
  164.         {    "reload1",    14,            Sound:LoadSound("Sounds/Weapons/OICW/oicwB_14.wav",0,155)},
  165.         {    "reload1",    32,            Sound:LoadSound("Sounds/Weapons/OICW/oicwB_32.wav",0,155)},
  166.         {    "reload2",    32,            Sound:LoadSound("Sounds/Weapons/OICW/oicwG_32.wav",0,155)},
  167.         {    "reload2",    48,            Sound:LoadSound("Sounds/Weapons/OICW/oicwG_48.wav",0,155)},
  168. --        {    "swim",        1,                Sound:LoadSound("Sounds/player/water/underwaterswim2.wav",0,255)},
  169.         
  170.     },
  171. }
  172.  
  173. CreateBasicWeapon(OICW);
  174.  
  175. ---------------------------------------------------------------
  176. --ANIMTABLE
  177. ------------------
  178. OICW.anim_table={}
  179. --AUTOMATIC FIRE
  180. OICW.anim_table[1]={
  181.     idle={
  182.         "Idle11",
  183.         "Idle21",
  184.     },
  185.     reload={
  186.         "Reload1",    
  187.     },
  188.     fire={
  189.         "Fire11",
  190.         "Fire21",
  191.     },
  192.     melee={
  193.         "Fire23",
  194.     },
  195.     swim={
  196.         "swim",
  197.     },
  198.     activate={
  199.         "Activate1",
  200.     },
  201. }
  202.  
  203. --AUTOMATIC FIRE
  204. OICW.anim_table[2]={
  205.     idle={
  206.         "Idle21",
  207.         "Idle22",
  208.     },
  209.     reload={
  210.         "Reload2",    
  211.     },
  212.     fire={
  213.         "Fire12",
  214.     },
  215.     melee={
  216.         "Fire23",
  217.     },
  218.     swim={
  219.         "swim",
  220.     },
  221.     activate={
  222.         "Activate1",
  223.     },
  224. }